﻿using OpenTK.Windowing.Desktop;

namespace testapp
{
    internal class Program
    {
        static void Main(string[] args)
        {
            GameWindowSettings setw = new GameWindowSettings();
            NativeWindowSettings setn = new NativeWindowSettings();
            {
                setn.API = OpenTK.Windowing.Common.ContextAPI.OpenGLES;
                setn.APIVersion = new Version(3, 0);
               // setn.Profile = OpenTK.Windowing.Common.ContextProfile.Core;

            }
            OpenTK.Windowing.Desktop.GameWindow window = new OpenTK.Windowing.Desktop.GameWindow(setw, setn);

            var ver =OpenTK.Graphics.ES30.GL.GetString(OpenTK.Graphics.ES30.StringName.Version);
            Console.WriteLine("ver=" + ver); 
            window.RenderFrame += (e) =>
            {
                OpenTK.Graphics.ES30.GL.Viewport(0, 0, window.ClientSize.X, window.ClientSize.Y);
                OpenTK.Graphics.ES30.GL.ClearColor(1, 0.5f, 1, 1);
                OpenTK.Graphics.ES30.GL.Clear(OpenTK.Graphics.ES30.ClearBufferMask.ColorBufferBit);

                window.SwapBuffers();
            };
            window.Run();
        }
    }
}